<template>
  <div>
      <el-table :data="userList" style="width: 100%" stripe border>
    <el-table-column prop="username" label="名字" align="center">
    </el-table-column>
    <el-table-column prop="email" label="邮箱" align="center">
    </el-table-column>
    <el-table-column prop="mobile" label="电话" align="center">
    </el-table-column>
    <el-table-column
      prop="role_name"
      label="超级管理员"
      align="center"
    >
    </el-table-column>
    <el-table-column prop="mg_state" label="状态" align="center">
      <template v-slot:default="scope">
        <el-switch
          v-model="scope.row.mg_state"
          active-color="#13ce66"
          inactive-color="#ff4949"
        >
        </el-switch>
      </template>
    </el-table-column>
    <!-- 管理用户 -->
    <el-table-column prop="" label="操作" align="center">
      <el-tooltip  effect="dark" content="编辑用户" placement="top-start">
        <el-button icon="el-icon-edit"></el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="删除用户" placement="top-start">
        <el-button icon="el-icon-delete"></el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="分配用户权限" placement="top-start">
        <el-button icon="el-icon-setting"></el-button>
      </el-tooltip>
    </el-table-column>
  </el-table>
  <!-- 分页管理 -->
     <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="1"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    userList: {
      type: Array,
    },
    userPage: {
      type:Object
    }
  },
  methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      }
    },
};
</script>

<style lang="scss" scoped>
</style>